﻿using Common;

namespace Domain.Entities
{
    public enum UserStatus
    {
        Default =0,
        Enable = 1,
        Disable = 2,
    }

    [Flags]
    public enum UserAttr : long
    {
        TypeUser = 1 << 1,
        TypeMangerUser = 1 << 2,
    }
    public class User : BaseEntity
    {
        public new long Id { get; set; }

        public  string LoginName { get; set; }

        public string? RealName { get; set; }

        public string? Email { get; set; }

        public  string Phone { get; set; }

        public string? Password { get; set; }

        public UserStatus Status { get; set; }

        public UserAttr Attr { get; set; }

        public ExtInfo ExtInfo { get; set; } = new();

        public bool HasPassword() => !string.IsNullOrEmpty(Password);
    }
    public class ExtInfo
    {
        public List<long> Roles { get; set; } = [];
    }


}
